import gates.*;

import java.lang.Math;

import master.*;

/**
 * A simple program i made to test the Hadamard and phase shift gate i built. A very basic quantum register is created,as well as the gate
 * before then acting the gate on the register to see what happens.
 * 
 * The gate can act on a system of any number of qubits, and any basis state, acting on any qubit.
 * 
 * @param args
 */
public class GateTest {
	public static void main(String[] args) {


		int N = 3;
		int dim = (int)Math.pow(2,N);

		QuantumRegister a = new QuantumRegister(N);
		a.setToEigenstate(1);

		for (int i =0; i < dim; i++){
		System.out.println("" + a.getCoefficient(i));

		}


/*

		Hadamard H = new Hadamard(N,1);
		PhaseShift phi = new PhaseShift(N,1);

		H.actOnReg(a);

		ComplexNo[] b =  a.seeRegister();
		for(int i = 0; i < dim; i++){
			System.out.println(""+ b[i]);
		}

		System.out.println("");
		H.actOnReg(a);

		b =  a.seeRegister();
		for(int i = 0; i < dim; i++){
			System.out.println(""+ b[i]);
		}


		System.out.println("" + a.truemeasure());

		a.setToEigenstate(2);

		phi.actOnReg(a);

		b =  a.seeRegister();
		for(int i = 0; i < dim; i++){
			System.out.println(""+ b[i]);
		}

		//        	H.actOnReg(a);
		//        	
		//        	b =  a.seeRegister();
		//        	for(int i = 0; i < dim; i++){
		//        		System.out.println(""+ b[i]);
		//        	}
		//        	
		//        	
		//        	System.out.println("" + a.truemeasure());
		//        	
		//        	H.actOnReg(a);
		//        	
		//        	b =  a.seeRegister();
		//        	for(int i = 0; i < dim; i++){
		//        		System.out.println(""+ b[i]);
		//        	}
		//        	
		//        	
		//        	System.out.println("" + a.truemeasure());
		//        	
		//        
//*/	
		}

}